//bitStream.h
#ifndef BITSTREAM_H
#define BITSTREAM_H

#include "variables.h"
#include <stdio.h>
#define FILEENDS -1

class BitStream
{
	private:
		FILE* file;
		int fileType;
		
		unchar prByte; //primary byte
		unchar restsSaver; //save rests
		unchar countRBits; //bits used in restsSaver
	public:	
		BitStream();
		~BitStream();
		int get(int count); // returns -1 when file ends
		int put(int value, int usedBits);
		int put(unchar* values, int usedBytes);
		int open(FILE* _file, char type);
		int close();
};
#endif
